<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>artifacts</title>
    <link href="../../images/logo-icon.svg" rel="icon" type="image/svg">
    <script>var pathToRoot = "../../";</script>
    <script>const storage = localStorage.getItem("dokka-dark-mode")
const savedDarkMode = storage ? JSON.parse(storage) : false
if(savedDarkMode === true){
    document.getElementsByTagName("html")[0].classList.add("theme-dark")
}</script>
<script type="text/javascript" src="../../scripts/sourceset_dependencies.js" async="async"></script>
<link href="../../styles/style.css" rel="Stylesheet">
<link href="../../styles/jetbrains-mono.css" rel="Stylesheet">
<link href="../../styles/main.css" rel="Stylesheet">
<link href="../../styles/prism.css" rel="Stylesheet">
<link href="../../styles/logo-styles.css" rel="Stylesheet">
<script type="text/javascript" src="../../scripts/clipboard.js" async="async"></script>
<script type="text/javascript" src="../../scripts/navigation-loader.js" async="async"></script>
<script type="text/javascript" src="../../scripts/platform-content-handler.js" async="async"></script>
<script type="text/javascript" src="../../scripts/main.js" defer="defer"></script>
<script type="text/javascript" src="../../scripts/prism.js" async="async"></script>
</head>
<body>
<div class="navigation-wrapper" id="navigation-wrapper">
    <div id="leftToggler"><span class="icon-toggler"></span></div>
    <div class="library-name">
            <a href="../../index.html">
                    <span>TeamCity Kotlin DSL</span>
            </a>
    </div>
    <div>
    </div>
    <div class="pull-right d-flex">
        <button id="theme-toggle-button"><span id="theme-toggle"></span></button>
        <div id="searchBar"></div>
    </div>
</div>
<div id="container">
    <div id="leftColumn">
        <div id="sideMenu"></div>
    </div>
    <div id="main">
<div class="main-content" id="content" pageIds="TeamCity Kotlin DSL::jetbrains.buildServer.configs.kotlin/Dependencies/artifacts/#jetbrains.buildServer.configs.kotlin.BuildType#kotlin.Function1[jetbrains.buildServer.configs.kotlin.ArtifactDependency,kotlin.Unit]/PointingToDeclaration//1411724783">
  <div class="breadcrumbs"><a href="../../index.html">TeamCity Kotlin DSL</a><span class="delimiter">/</span><a href="../index.html">jetbrains.buildServer.configs.kotlin</a><span class="delimiter">/</span><a href="index.html">Dependencies</a><span class="delimiter">/</span><a href="artifacts.html">artifacts</a></div>
  <div class="cover ">
    <h1 class="cover"><span><span>artifacts</span></span></h1>
  </div>
  <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":dokkaHtml/main"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="artifacts.html"><span class="token function">artifacts</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">buildType<span class="token operator">: </span><a href="../build-type/index.html">BuildType</a><span class="token punctuation">, </span></span><span class="parameter ">init<span class="token operator">: </span><span class="token keyword"></span><a href="../artifact-dependency/index.html">ArtifactDependency</a><span class="token punctuation">.</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></span></span><span class="token punctuation">)</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">Adds an <a href="https://www.jetbrains.com/help/teamcity/?Artifact+Dependencies">artifact dependency</a> on the specified buildType</p><p class="paragraph"><strong>Example.</strong> Artifact dependency on artifacts of some pinned build</p><p class="paragraph">See also <a href="https://www.jetbrains.com/help/teamcity/dependent-build.html#DependentBuild-ArtifactDependency">artifact dependency</a></p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">dependencies {<br>    artifacts(AnotherBuild) {<br>        buildRule = lastPinned()<br>        // this rule will find all the jar files in the build artifacts root directory<br>        // and place them under the &quot;library&quot; folder on the agent<br>        artifactRules = &quot;*.jar =&gt; libraries&quot;<br>        // this will ensure that &quot;libraries&quot; folder is cleaned up before the .jar files are placed there<br>      cleanDestination = true<br>    }<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph"><strong>Example.</strong> Artifact dependency on a build outside of Kotlin DSL project</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">dependencies {<br>    artifacts(AbsoluteId(&quot;Another_Project_Library&quot;)) {<br>        buildRule = lastSuccessful()<br>        artifactRules = &quot;*.jar =&gt; libraries&quot;<br>        cleanDestination = true<br>    }<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">In this example &quot;Another_Project_Library&quot; is an id of a build configuration which is not defined in the Kotlin DSL project, but exists somewhere else in the TeamCity projects hierarchy.</p><h2 class="">Parameters</h2><div data-togglable="Parameters"><div class="table" data-togglable="Parameters"><div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex"><div><span>build</span><wbr></wbr><span><span>Type</span></span></div></span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">buildType to depend on</p></div></div></div></div></div><div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex"><div><span><span>init</span></span></div></span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">function to initialize the artifact dependency</p></div></div></div></div></div></div></div><br><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="artifacts.html"><span class="token function">artifacts</span></a><span class="token punctuation">(</span><span class="parameters "><span class="parameter ">buildTypeId<span class="token operator">: </span><a href="../id/index.html">Id</a><span class="token punctuation">, </span></span><span class="parameter ">init<span class="token operator">: </span><span class="token keyword"></span><a href="../artifact-dependency/index.html">ArtifactDependency</a><span class="token punctuation">.</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a></span></span><span class="token punctuation">)</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">Adds an <a href="https://www.jetbrains.com/help/teamcity/?Artifact+Dependencies">artifact dependency</a> on the buildType with the specified id</p><p class="paragraph"><strong>Example.</strong> Artifact dependency on artifacts of some pinned build</p><p class="paragraph">See also <a href="https://www.jetbrains.com/help/teamcity/dependent-build.html#DependentBuild-ArtifactDependency">artifact dependency</a></p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">dependencies {<br>  artifacts(AnotherBuild) {<br>    buildRule = lastPinned()<br>    // this rule will find all the jar files in the build artifacts root directory<br>    // and place them under the &quot;library&quot; folder on the agent<br>    artifactRules = &quot;*.jar =&gt; libraries&quot;<br>    // this will ensure that &quot;libraries&quot; folder is cleaned up before the .jar files are placed there<br>    cleanDestination = true<br>  }<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph"><strong>Example.</strong> Artifact dependency on a build outside of Kotlin DSL project</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">dependencies {<br>  artifacts(AbsoluteId(&quot;Another_Project_Library&quot;)) {<br>    buildRule = lastSuccessful()<br>    artifactRules = &quot;*.jar =&gt; libraries&quot;<br>    cleanDestination = true<br>  }<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">In this example &quot;Another_Project_Library&quot; is an id of a build configuration which is not defined in the Kotlin DSL project, but exists somewhere else in the TeamCity projects hierarchy.</p><h2 class="">Parameters</h2><div data-togglable="Parameters"><div class="table" data-togglable="Parameters"><div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex"><div><span>build</span><wbr></wbr><span>Type</span><wbr></wbr><span><span>Id</span></span></div></span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">id of the buildType to depend on</p></div></div></div></div></div><div class="table-row" data-filterable-current=":dokkaHtml/main" data-filterable-set=":dokkaHtml/main"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex"><div><span><span>init</span></span></div></span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">function to initialize the artifact dependency</p></div></div></div></div></div></div></div></div></div>
</div>
        <div class="footer"><span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2023 Copyright</span><span
                class="pull-right"><span>Generated by </span><a
                href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span>
        </div>
    </div>
</div>
</body>
</html>
